package 强化训练;

import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;

public class day35抄送列表 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        while (sc.hasNextLine()) {
            String nameList = sc.nextLine();
            String name = sc.nextLine();
            Set<String> set = new HashSet<>();
            int i = 0;
            int end = 0;
            while (i < nameList.length()){
                //碰到了以引号开头的姓名
                if ('\"' == nameList.charAt(i)){
                    //从i+1位置开始向后寻找，找到第一指定字符，返回指定位置的索引
                    end = nameList.indexOf('\"',i+1);
                    set.add(nameList.substring(i+1,end));
                    i = end + 2;//跳过当前名字后面的逗号
                }else {
                    end = nameList.indexOf(',',i+1);
                    if (-1 == end){
                        set.add(nameList.substring(i));
                        i = nameList.length();
                    }else {
                        set.add(nameList.substring(i,end));
                        i = end+1;
                    }
                }
            }

            if (set.contains(name)){
                System.out.println("Ignore");
            }else {
                System.out.println("Important!");
            }
        }
    }
}
